package com.surelution.projects.tour;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.UUID;
import java.util.Vector;

public class Test {

	public static void main(String[] args) throws Exception {
//		File file = new File("database/");
//		String path = file.getAbsolutePath();
//		System.out.println(path);
		
		Class.forName("org.hsqldb.jdbcDriver");
		Connection conn = DriverManager.getConnection("jdbc:hsqldb:file:/Users/syujohnny/Desktop/database/mydb","sa","");
		PreparedStatement stat = conn.prepareStatement("select * from RAW_PATROL_INFO");
		ResultSet rs = stat.executeQuery();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		while(rs.next()) {
			String id = rs.getString("id");
			Timestamp t = rs.getTimestamp("PATROL_TIME");
			System.out.println(sdf.format(t));
		}
		rs.close();
		stat.close();
		conn.close();
	}
}
